package org.example.controller;

import org.example.feifan.datasource.entity.SysUserDto;
import org.example.service.SysUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Donald
 * @create 2020-04-18 23:03
 */
@RestController
@RequestMapping("user")
public class SysUserController {

    @Resource(name = "sysUserServiceImpl")
    private SysUserService sysUserService;

    @Resource(name = "sysUserServiceImpl2")
    private SysUserService sysUserService2;

    @Resource(name = "sysUserServiceImpl3")
    private SysUserService sysUserService3;

    @GetMapping(value = "selectOne")
    public SysUserDto selectOne(){
        return sysUserService.selectOne();
    }

    @GetMapping("findall")
    public List<SysUserDto> findAll(){
        return sysUserService.findAll();
    }

    @GetMapping("queryone")
    public SysUserDto queryOne(){
        return sysUserService.queryOne();
    }

    @GetMapping("query")
    public SysUserDto queryDoubleDatasource(){
        return sysUserService2.selectOne();
    }

    @GetMapping("query/salve")
    public SysUserDto querySingleDatasource(){
        return sysUserService2.queryOne();
    }

    @GetMapping("query/header")
    public SysUserDto queryHeadId(){
        return sysUserService3.selectOne();
    }
}
